package com.xqls.dal.dao.mybatis;

import com.xqls.dal.dao.FluggasBlockAdministrationDao;
import com.xqls.dal.model.FluggasBlockAdministration;
import com.xqls.dal.model.FluggasBlockAdministrationExample;
import com.xqls.dal.service.FluggasBlockAdministrationMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by hdg on 2017/7/5.
 */
@Repository
public class FluggasBlockAdministrationDaoImpl implements FluggasBlockAdministrationDao {
    @Autowired
    FluggasBlockAdministrationMapper mapper;
    @Override
    public int countByExample(FluggasBlockAdministrationExample example) {
        return 0;
    }

    @Override
    public int deleteByExample(FluggasBlockAdministrationExample example) {
        return mapper.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(Integer fluggasId) {
        return mapper.deleteByPrimaryKey(fluggasId);
    }

    @Override
    public boolean insert(FluggasBlockAdministration record) {
        return mapper.insert(record)>0;
    }

    @Override
    public int insertSelective(FluggasBlockAdministration record) {
        return mapper.insertSelective(record);
    }

    @Override
    public List<FluggasBlockAdministration> selectByExample(FluggasBlockAdministrationExample example) {
        return null;
    }

    @Override
    public FluggasBlockAdministration selectByPrimaryKey(Integer fluggasId) {
        return mapper.selectByPrimaryKey(fluggasId);
    }

    @Override
    public int updateByExampleSelective(@Param("record") FluggasBlockAdministration record, @Param("example") FluggasBlockAdministrationExample example) {
        return mapper.updateByExample(record,example);
    }

    @Override
    public int updateByExample(@Param("record") FluggasBlockAdministration record, @Param("example") FluggasBlockAdministrationExample example) {
        return mapper.updateByExample(record,example);
    }

    @Override
    public int updateByPrimaryKeySelective(FluggasBlockAdministration record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(FluggasBlockAdministration record) {
        return mapper.updateByPrimaryKey(record);
    }

    @Override
    public List<FluggasBlockAdministration> selectByblock(Map<String,Object> map) {
        return mapper.selectByblock(map);
    }

    @Override
    public List<Map<String, Object>> selectAll(Map<String, Object> map) {
        return mapper.selectAll(map);
    }

    @Override
    public FluggasBlockAdministration selectByblockId(int blockId) {
        return mapper.selectByblockId(blockId);
    }

    @Override
    public boolean addFile(String filed, String type) {
        Map<String, Object> map=new HashMap<String, Object>();
        map.put("filed", filed);
        map.put("type", type);

        if(mapper.addFiled(map)==0){
            return true;
        }else {
            return false;
        }


    }
}
